
#include "wtp_state.h"

#define DEFAULT_DISCOVERYINTERVAL	5

int DiscoveryInterval = 0;	/* 4.7.5 */
int SilentInterval = 0;		/* 4.7.13 */

int DiscoveryCount = 0;		/* 4.8.2 */
int FailedDTLSAuthFailCount;/* 4.8.3 */
int FailedDTLSSessionCount;	/* 4.8.4 */
int MaxDiscoveries = 0;		/* 4.8.5 */

wtp_state_t wtp_state_discovery()
{

	if(DiscoveryCount == MaxDiscoveries) {
		return WTP_STATE_SULKING;
	}
	
	/* 3.3 */
	Discovery Request message

	return WTP_STATE_DTLS_SETUP;
}

wtp_state_t wtp_state_sulking()
{
	/* SilentInterval */
	
	FailedDTLSSessionCount = 0;
	DiscoveryCount = 0;
	FailedDTLSAuthFailCount = 0;
	
	return WTP_STATE_IDLE;
}
